package com.wondersgroup.aida.base;

import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.openai.OpenAiChatModel;

/**
 * @author: 紫麒麟vip
 * @create: 2025/2/15
 * Description:
 */
public class HelloWorld {
    public static void main(String[] args) {
        ChatLanguageModel model = OpenAiChatModel.builder()
                .apiKey("demo")
                .modelName("gpt-4o-mini")
                .build();

        String answer = model.generate("你是谁？");
        System.out.println(answer);

        String answer2 = model.generate("请重复一次");
        System.out.println(answer2);

//        UserMessage userMessage = UserMessage.from("你是谁");
//        Response<AiMessage> response = model.generate(userMessage);
//        AiMessage aiMessage = response.content();
//        System.out.println(aiMessage.text());
//
//        UserMessage userMessage2 = UserMessage.from("请重复一次");
//        Response<AiMessage> response2 = model.generate(userMessage, aiMessage, userMessage2);
//        System.out.println(response2.content().text());

    }
}
